package com.lxf.service;

import com.lxf.dao.ProductDao;
import com.lxf.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class ProductServiceImpl implements ProductService {


    @Autowired
    private ProductDao productDao;

    // 多条件查询商品排序
    @Override
    public List<Product> Findquery(Product product) {
        return productDao.Findquery(product);
    }
    //查询商品
    @Override
    public Product listAlls(Product p) {
        return (Product) productDao.listAlls(p);
    }
    //显示某一种产品的图片
    @Override
    public List<Product> Image(Product p) {
        return productDao.Image(p);
    }
    //显示商品类型
    @Override
    public List<Product> shopModel(Product p) {
        return productDao.shopModel(p);
    }

    @Override
    public Product isCollect(int productId, int userId) {
        return (Product) productDao.isCollect(productId,userId);
    }

    //展示用户足迹
    @Override
    public List<Product> UserFoot(int id) {
        return productDao.UserFoot(id);
    }

    @Override
    public Product userFootIsFlag(int userId, int id) {
        return (Product) productDao.userFootIsFlag(userId,id);
    }

    @Override
    public int updateUserFoot(int id) {
        return productDao.updateUserFoot(id);
    }

    @Override
    public List<Product> smallClassify(List<Product> p) {
        return productDao.smallClassify(p);
    }

    @Override
    public List<Product> Classify() {
        return productDao.Classify();
    }

    @Override
    public List<Product> productId(Product p) {
        return productDao.productId(p);
    }


    @Override
    public List<Product> productClassify() {
        return productDao.productClassify();
    }

    @Override
    public List<Product> productClassifyInfo(int id) {
        return productDao.productClassifyInfo(id);
    }

    @Override
    public List<Product> shopModelInfo(int id, String productModel) {
        return productDao.shopModelInfo(id,productModel);
    }
    @Override
    public List<Product> LookCollect(int id) {
        return productDao.LookCollect(id);
    }


    @Override
    public List<Product> LookOrder(int id, int orderStatus) {
        return productDao.LookOrder(id,orderStatus);
    }

    @Override
    public boolean delShopCar(int id) {
        return productDao.delShopCar(id);
    }

    @Override
    public int addShopCar(Product p) {
        return productDao.addShopCar(p);
    }

    @Override
    public int updateShopCar(int quantity, int id) {
        return productDao.updateShopCar(quantity,id);
    }

    @Override
    public List<Product> LookShopCar(int id) {
        return productDao.LookShopCar(id);
    }




}
